package org.hard.model.structure.bridge;

/**
 * @author: 王林博
 * @date: 2023年02月17日 11:10
 */
public abstract class RemoteControl {

    Device device;


    RemoteControl(Device device){
        this.device = device;
    }


    // 开关
    void togglePower(){
        if(Boolean.TRUE.equals(device.isEnabled())){
            device.disable();
            System.out.println("关闭");
        }else {
            device.enable();
            System.out.println("启动");
        }
    }


    void volumeDown(){
        device.setVolume(device.getVolume() - 10);
    }

    void volumeUp(){
        device.setVolume(device.getVolume() + 10);
    }

    void channelDown(){
        device.setChannel(device.getChannel() - 1);
    }
    void channelUp(){
        device.setChannel(device.getChannel() + 1);
    }
}
